﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Common.Utily
{
    public static class Datetimes
    {
        public readonly static DateTime UnixEpoch = new DateTime(1970, 1, 1);

        // equivalent to PHP mktime :
        public static int GetUnixTimestamp(DateTime dt)
        {
            TimeSpan span = dt - UnixEpoch;
            return (int)span.TotalSeconds;
        }
    }
}